package a.g;

import a.c.k;
import a.f.cb;
import a.f.l.hb;
import a.f.n.a;
import a.f.n.b;
import a.f.n.c;
import a.f.rc;
import a.f.vc;
import a.h.dc;
import a.h.ec;
import a.h.z;
import a.i.p;
import a.j.pg;

import java.awt.*;

public class fb
  extends h
{
  private static final String q = "LAYOUT_STYLE";
  private static final String r = "PREFERRED_CHILD_WEDGE";
  private static final String s = "DIRECTED_ROOT";
  private static final String t = "LEFT_TO_RIGHT";
  private static final String u = "ALLOW_OVERLAPS";
  private static final String v = "GENERAL";
  private static final String w = "ALLOW_NON_TREES";
  private static final String x = "ROUTING_STYLE_FOR_NON_TREE_EDGES";
  private static final String y = "ROUTE_ORGANIC";
  private static final String z = "ROUTE_ORTHOGONAL";
  private static final String A = "ROUTE_STRAIGHTLINE";
  private static final String B = "COMPACTNESS_FACTOR";
  private static final String C = "MINIMAL_NODE_DISTANCE";
  private static final String D = "ACT_ON_SELECTION_ONLY";
  private static final String E = "BOTTOM_TO_TOP";
  private static final String F = "BALLOON";
  private static final String G = "MINIMAL_LAYER_DISTANCE";
  private static final String H = "ORIENTATION";
  private static final String I = "PREFERRED_ROOT_WEDGE";
  private static final String J = "RIGHT_TO_LEFT";
  private static final String K = "HV";
  private static final String L = "VERTICAL_SPACE";
  private static final String M = "AR";
  private static final String N = "HORIZONTAL_SPACE";
  private static final String O = "TREE";
  private static final String P = "TOP_TO_BOTTOM";
  private static final String Q = "MINIMAL_EDGE_LENGTH";
  private static final String R = "ROOT_NODE_POLICY";
  private static final String S = "CENTER_ROOT";
  private static final String T = "WEIGHTED_CENTER_ROOT";
  private static final String U = "BEND_DISTANCE";
  private static final String V = "ASPECT_RATIO";
  private static final String W = "USE_VIEW_ASPECT_RATIO";
  private static final String X = "DIRECTED";
  private static final String Y = "ORTHOGONAL_EDGE_ROUTING";
  private static final String Z = "CHILD_PLACEMENT_POLICY";
  private static final String ab = "SIBLINGS_ON_SAME_LAYER";
  private static final String bb = "ALL_LEAVES_ON_SAME_LAYER";
  private static final String cb = "LEAVES_STACKED";
  private static final String db = "LEAVES_STACKED_LEFT";
  private static final String eb = "LEAVES_STACKED_RIGHT";
  private static final String[] fb = { "SIBLINGS_ON_SAME_LAYER", "ALL_LEAVES_ON_SAME_LAYER", "LEAVES_STACKED", "LEAVES_STACKED_LEFT", "LEAVES_STACKED_RIGHT" };
  private static final String gb = "ENFORCE_GLOBAL_LAYERING";
  private static final String hb = "INTEGRATED_EDGE_LABELING";
  private static final String ib = "INTEGRATED_NODE_LABELING";
  private static final String jb = "VERTICAL_ALIGNMENT";
  private static final String kb = "BUS_ALIGNMENT";
  private static final String lb = "FROM_SKETCH";
  private static final String[] mb = { "ROUTE_ORGANIC", "ROUTE_ORTHOGONAL", "ROUTE_STRAIGHTLINE" };
  private static final String[] nb = { "DIRECTED", "BALLOON", "HV", "AR" };
  private static final String[] ob = { "TOP_TO_BOTTOM", "LEFT_TO_RIGHT", "BOTTOM_TO_TOP", "RIGHT_TO_LEFT" };
  private static final String[] pb = { "DIRECTED_ROOT", "CENTER_ROOT", "WEIGHTED_CENTER_ROOT" };
  private static final String qb = "PORT_STYLE";
  private static final String rb = "NODE_CENTER";
  private static final String sb = "BORDER_CENTER";
  private static final String tb = "BORDER_DISTRIBUTED";
  private static final String[] ub = { "NODE_CENTER", "BORDER_CENTER", "BORDER_DISTRIBUTED" };
  public static int vb;
  
  public fb()
  {
    super("TREE", "yFiles Layout Team", "A layouter for tree structures");
    d(true);
  }
  
  public dc j()
  {
    dc localdc = new dc(a());
    localdc.l("GENERAL");
    localdc.a("LAYOUT_STYLE", nb, 0);
    localdc.a("ALLOW_NON_TREES", false);
    localdc.a("ROUTING_STYLE_FOR_NON_TREE_EDGES", mb, 0);
    z localz = new z(localdc);
    localz.a("ALLOW_NON_TREES", Boolean.TRUE, "ROUTING_STYLE_FOR_NON_TREE_EDGES");
    localdc.a("ACT_ON_SELECTION_ONLY", false);
    localdc.l("DIRECTED");
    a.f.n.g localg = new a.f.n.g();
    localdc.a("MINIMAL_NODE_DISTANCE", (int)localg.y(), 1, 100);
    localdc.a("MINIMAL_LAYER_DISTANCE", (int)localg.z(), 10, 300);
    localdc.a("ORIENTATION", ob, 0);
    localdc.a("PORT_STYLE", ub, 0);
    localdc.a("INTEGRATED_NODE_LABELING", false);
    localdc.a("INTEGRATED_EDGE_LABELING", false);
    ec localec1 = localdc.a("ORTHOGONAL_EDGE_ROUTING", false);
    ec localec2 = localdc.a("BUS_ALIGNMENT", 0.5D, 0.0D, 1.0D);
    ec localec3 = localdc.a("VERTICAL_ALIGNMENT", 0.5D, 0.0D, 1.0D);
    localdc.a("CHILD_PLACEMENT_POLICY", fb, 0);
    localdc.a("ENFORCE_GLOBAL_LAYERING", false);
    localec2.a(gb.h, "TOP");
    localec2.a(gb.g, "BOTTOM");
    new z(localdc).a(localec1, Boolean.TRUE, localec2);
    localec3.a(gb.h, "TOP");
    localec3.a(gb.g, "BOTTOM");
    localdc.l("BALLOON");
    c localc = new c();
    localdc.a("ROOT_NODE_POLICY", pb, 0);
    localdc.a("PREFERRED_CHILD_WEDGE", localc.x(), 1, 359);
    localdc.a("PREFERRED_ROOT_WEDGE", localc.w(), 1, 360);
    localdc.a("MINIMAL_EDGE_LENGTH", localc.A(), 10, 400);
    localdc.a("COMPACTNESS_FACTOR", localc.z(), 0.1D, 0.9D);
    localdc.a("ALLOW_OVERLAPS", localc.y());
    localdc.a("FROM_SKETCH", localc.u());
    localdc.l("HV");
    a.f.n.e locale = new a.f.n.e();
    localdc.a("HORIZONTAL_SPACE", (int)locale.a());
    localdc.a("VERTICAL_SPACE", (int)locale.s());
    localdc.l("AR");
    b localb = new b();
    localdc.a("HORIZONTAL_SPACE", (int)localb.a());
    localdc.a("VERTICAL_SPACE", (int)localb.s());
    localdc.a("BEND_DISTANCE", (int)localb.x());
    localdc.a("USE_VIEW_ASPECT_RATIO", true);
    localdc.a("ASPECT_RATIO", localb.u());
    localz.a("USE_VIEW_ASPECT_RATIO", Boolean.FALSE, "ASPECT_RATIO");
    return localdc;
  }
  
  public void n()
  {
    int i = f.p;
    boolean bool = f.o;
    Object localObject1 = null;
    a.j.g localg = e();
    dc localdc = i();
    String str = localdc.h("LAYOUT_STYLE");
    Object localObject3;
    label203:
    label209:
    label236:
    label239:
    Object localObject4;
    if (i == 0) {
      if (str.equals("DIRECTED"))
      {
        localObject2 = new a.f.n.g();
        ((a.f.n.g)localObject2).a(localdc.c("DIRECTED", "MINIMAL_NODE_DISTANCE"));
        ((a.f.n.g)localObject2).b(localdc.c("DIRECTED", "MINIMAL_LAYER_DISTANCE"));
        localObject3 = (cb)((a.f.n.g)localObject2).h();
        if (i == 0) {
          if (localdc.h("ORIENTATION").equals("TOP_TO_BOTTOM"))
          {
            ((cb)localObject3).a((byte)0);
            if (i != 0) {
              break label209;
            }
            if (!bool) {
              break label203;
            }
          }
        }
        if (i == 0) {
          if (localdc.h("ORIENTATION").equals("BOTTOM_TO_TOP"))
          {
            ((cb)localObject3).a((byte)2);
            if (i != 0) {
              break label209;
            }
            if (!bool) {
              break label203;
            }
          }
        }
        if (i == 0)
        {
          if (localdc.h("ORIENTATION").equals("RIGHT_TO_LEFT")) {
            ((cb)localObject3).a((byte)3);
          }
        }
        else
        {
          if (i != 0) {
            break label209;
          }
          if (!bool) {
            break label203;
          }
        }
        ((cb)localObject3).a((byte)1);
        if (i == 0)
        {
          if (localdc.g("ORTHOGONAL_EDGE_ROUTING"))
          {
            if (i != 0) {
              break label236;
            }
            ((a.f.n.g)localObject2).b(1);
          }
        }
        else {
          if (!bool) {
            break label239;
          }
        }
        ((a.f.n.g)localObject2).b(0);
        localObject4 = localdc.h("CHILD_PLACEMENT_POLICY");
        if (i == 0) {
          if ("SIBLINGS_ON_SAME_LAYER".equals(localObject4))
          {
            ((a.f.n.g)localObject2).b((byte)5);
            if (i != 0) {
              break label398;
            }
            if (!bool) {
              break label392;
            }
          }
        }
        if (i == 0) {
          if ("LEAVES_STACKED_LEFT".equals(localObject4))
          {
            ((a.f.n.g)localObject2).b((byte)1);
            if (i != 0) {
              break label398;
            }
            if (!bool) {
              break label392;
            }
          }
        }
        if (i == 0) {
          if ("LEAVES_STACKED_RIGHT".equals(localObject4))
          {
            ((a.f.n.g)localObject2).b((byte)2);
            if (i != 0) {
              break label398;
            }
            if (!bool) {
              break label392;
            }
          }
        }
        if (i == 0) {
          if ("LEAVES_STACKED".equals(localObject4))
          {
            ((a.f.n.g)localObject2).b((byte)0);
            if (i != 0) {
              break label398;
            }
            if (!bool) {
              break label392;
            }
          }
        }
        if (i == 0) {
          if ("ALL_LEAVES_ON_SAME_LAYER".equals(localObject4)) {
            ((a.f.n.g)localObject2).b((byte)4);
          }
        }
        label392:
        label398:
        if (i == 0)
        {
          if (localdc.g("ENFORCE_GLOBAL_LAYERING")) {
            ((a.f.n.g)localObject2).h(true);
          }
        }
        else
        {
          if (i != 0) {
            break label439;
          }
          if (!bool) {
            break label428;
          }
        }
        ((a.f.n.g)localObject2).h(false);
        label428:
        label439:
        if (i == 0) {
          if (localdc.h("PORT_STYLE").equals("NODE_CENTER"))
          {
            ((a.f.n.g)localObject2).a(0);
            if (i != 0) {
              break label562;
            }
            if (!bool) {
              break label518;
            }
          }
        }
        if (i == 0) {
          if (localdc.h("PORT_STYLE").equals("BORDER_CENTER"))
          {
            ((a.f.n.g)localObject2).a(1);
            if (i != 0) {
              break label562;
            }
          }
        }
        if ((bool) && (localdc.h("PORT_STYLE").equals("BORDER_DISTRIBUTED"))) {
          ((a.f.n.g)localObject2).a(2);
        }
        label518:
        ((a.f.n.g)localObject2).j(localdc.g("INTEGRATED_NODE_LABELING"));
        ((a.f.n.g)localObject2).k(localdc.g("INTEGRATED_EDGE_LABELING"));
        ((a.f.n.g)localObject2).d(localdc.f("VERTICAL_ALIGNMENT"));
        ((a.f.n.g)localObject2).c(localdc.f("BUS_ALIGNMENT"));
        label562:
        localObject1 = localObject2;
        break label993;
      }
    }
    if (i == 0) {
      if (str.equals("BALLOON"))
      {
        localObject2 = new c();
        if (i == 0) {
          if (localdc.j("ROOT_NODE_POLICY").equals(pb[0]))
          {
            ((c)localObject2).c((byte)0);
            if (i != 0) {
              break label742;
            }
            if (!bool) {
              break label674;
            }
          }
        }
        if (i == 0)
        {
          if (localdc.j("ROOT_NODE_POLICY").equals(pb[1]))
          {
            ((c)localObject2).c((byte)1);
            if (i != 0) {
              break label742;
            }
          }
        }
        else {
          if (!bool) {
            break label674;
          }
        }
        ((c)localObject2).c((byte)2);
        label674:
        ((c)localObject2).b(localdc.e("PREFERRED_CHILD_WEDGE"));
        ((c)localObject2).c(localdc.e("PREFERRED_ROOT_WEDGE"));
        ((c)localObject2).d(localdc.c("BALLOON", "MINIMAL_EDGE_LENGTH"));
        ((c)localObject2).a(localdc.f("COMPACTNESS_FACTOR"));
        ((c)localObject2).i(localdc.g("ALLOW_OVERLAPS"));
        ((c)localObject2).h(localdc.g("FROM_SKETCH"));
        label742:
        localObject1 = localObject2;
        break label993;
      }
    }
    if (i == 0) {
      if (str.equals("HV"))
      {
        localObject2 = new a.f.n.e();
        localObject3 = new p()
        {
          public Object get(Object paramAnonymousObject)
          {
            if (f.p == 0) {
              if (fb.this.e().y((a.c.e)paramAnonymousObject)) {
                return a.f.n.e.y;
              }
            }
            return a.f.n.e.x;
          }
        };
        localg.a(a.f.n.e.w, (k)localObject3);
        ((a.f.n.e)localObject2).a(localdc.c("HV", "HORIZONTAL_SPACE"));
        ((a.f.n.e)localObject2).b(localdc.c("HV", "VERTICAL_SPACE"));
        localObject1 = localObject2;
        break label993;
      }
    }
    if (str.equals("AR"))
    {
      localObject2 = new b();
      localObject3 = new p()
      {
        public Object get(Object paramAnonymousObject)
        {
          if (f.p == 0) {
            if (fb.this.e().y((a.c.e)paramAnonymousObject)) {
              return b.D;
            }
          }
          return b.E;
        }
      };
      if (localdc.g("USE_VIEW_ASPECT_RATIO"))
      {
        localObject4 = g();
        if (i == 0)
        {
          if (localObject4 != null)
          {
            Dimension localDimension = ((pg)localObject4).getSize();
            ((b)localObject2).c(localDimension.getWidth() / localDimension.getHeight());
            if (i != 0) {
              break label990;
            }
            if (!bool) {}
          }
          else
          {
            ((b)localObject2).c(1.0D);
          }
        }
        else
        {
          if (i != 0) {
            break label990;
          }
          if (!bool) {}
        }
      }
      else
      {
        ((b)localObject2).c(localdc.f("ASPECT_RATIO"));
      }
      ((b)localObject2).a(localdc.c("AR", "HORIZONTAL_SPACE"));
      ((b)localObject2).b(localdc.c("AR", "VERTICAL_SPACE"));
      ((b)localObject2).d(localdc.c("AR", "BEND_DISTANCE"));
      localg.a(b.C, (k)localObject3);
      label990:
      localObject1 = localObject2;
    }
    label993:
    localObject1.g(localdc.g("ACT_ON_SELECTION_ONLY"));
    Object localObject2 = null;
    if (localdc.g("ALLOW_NON_TREES"))
    {
      localObject2 = new a();
      localObject1.b((vc)localObject2);
      if (i == 0) {
        if ("ROUTE_ORGANIC".equals(localdc.j("ROUTING_STYLE_FOR_NON_TREE_EDGES")))
        {
          localObject3 = new hb();
          ((a)localObject2).b((rc)localObject3);
          ((a)localObject2).a(hb.B);
        }
      }
      if (i == 0) {
        if ("ROUTE_ORTHOGONAL".equals(localdc.j("ROUTING_STYLE_FOR_NON_TREE_EDGES")))
        {
          localObject3 = new a.f.l.g();
          ((a.f.l.g)localObject3).b(1.0D);
          ((a.f.l.g)localObject3).c(true);
          ((a.f.l.g)localObject3).b((byte)2);
          ((a)localObject2).a(((a.f.l.g)localObject3).c());
          ((a)localObject2).b((rc)localObject3);
        }
      }
      if ("ROUTE_STRAIGHTLINE".equals(localdc.j("ROUTING_STYLE_FOR_NON_TREE_EDGES"))) {
        ((a)localObject2).b(((a)localObject2).d());
      }
    }
    try
    {
      a(localObject1);
    }
    finally
    {
      localg.j(b.C);
      localg.j(a.f.n.e.w);
      if (localObject2 != null) {
        localObject1.c((vc)localObject2);
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.g.fb

 * JD-Core Version:    0.7.0.1

 */